Skip to content

Comments

Retain className for EuiFormControlLayout.prepend nodes#2796

Merged
thompsongl merged 3 commits intoelastic:masterfrom
nreese:prepend_className
Jan 27, 2020
Merged

Retain className for EuiFormControlLayout.prepend nodes#2796
thompsongl merged 3 commits intoelastic:masterfrom
nreese:prepend_className

Conversation

@nreese
Copy link
Contributor

@nreese nreese commented Jan 27, 2020

Kibana maps application is using EuiFieldText to show the selected icon. This uses the prepend property like this. The problem is that the className property is not getting passed to the rendered prepend prop because EuiFormControlLayout over rights that prop to a static value. This PR just updates the logic to preserve the original className when provided.

        <EuiFieldText
          onClick={this._togglePopover}
          onKeyDown={this._handleKeyboardActivity}
          value={value}
          compressed
          readOnly
          fullWidth
          prepend={
            <SymbolIcon
              className="mapIconSelectSymbol__inputButton"
              symbolId={value}
              fill={isDarkMode ? 'rgb(223, 229, 239)' : 'rgb(52, 55, 65)'}
              stroke={isDarkMode ? 'rgb(255, 255, 255)' : 'rgb(0, 0, 0)'}
              strokeWidth={'1px'}
            />
          }
        />

Screen Shot 2020-01-27 at 11 58 04 AM

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks, @nreese!

Can you add a changelog entry, also?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants